<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>demo</title>
        <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="jquery.base64.js"></script>
    </head>
    <body>
        <button onclick="login()"></button>
        <script>
            function login(){
                var params = {
                    "secretKey": "e1xydGYxXGFuc2lcZGVmZjB7XGNvbG9ydGJsO1xyZWQ5XGdyZWVuOVxibHVlOTtccmVkMjU1XGdy",
                    "portalID": "1234567890",
                    "password": "1234567890"
                }
                var params64 = $.base64.encode(JSON.stringify(params));
                $.ajax({
                    type: "POST",
                    url: "https://yiban.chd.edu.cn/portrait/main",
                    async: false,
                    data: {
                        key : params64
                    },
                    success: function(data) { //data封装的xhr.responseText
                        console.log(data)
                    },
                    error: function(xhr) {
                        console.log(xhr.status)
                    }
                });
            }
        </script>
    </body>
</html>